package fhb.mobile.todoapp;

import java.util.Date;

import fhb.mobile.todoapp.datamodell.ToDoItem;
import fhb.mobile.todoapp.datamodell.ToDoItemList;

public class Connection {

	private static ToDoItemList liste = new ToDoItemList();
	
	public static boolean authenticate(String mail, String password) {
		liste.setMail(mail);
		liste.setPassword(password);
		fillToDoItemListWithAShitLotOfNonsensToDos_Yepp();
		
		// Username bekommen: liste.getMail() usw.
		
		return true;
	}

	public static ToDoItemList getListe() {
		return liste;
	}

	private static void setListe(ToDoItemList liste) {
		// guck selber, ob du das brauchst
		
		Connection.liste = liste;
	}
	
	
	
	private static void fillToDoItemListWithAShitLotOfNonsensToDos_Yepp() {
		liste.add(new ToDoItem(new Date(2012,1,14,12,0), "ToDo #1", "Content #1", new Date(2012,1,15,12,0), true, true, null, null));
		liste.add(new ToDoItem(new Date(2012,1,15,12,0), "ToDo #2", "Content #2", new Date(2012,1,16,12,0), false, false, null, null));
		liste.add(new ToDoItem(new Date(2012,1,16,12,0), "ToDo #3", "Content #3", new Date(2012,1,17,12,0), false, true, null, null));
		liste.add(new ToDoItem(new Date(2012,1,17,12,0), "ToDo #4", "Content #4", new Date(2012,1,18,12,0), true, false, null, null));
	}
}
